<template>
  <div id="cart-list">
    <cart-list-item v-for="item in cartList" :key="item.iid" :goods="item" />
  </div>
</template>

<script>
//引入getters
import { mapGetters } from 'vuex'

//子组件
import CartListItem from './CartListItem'

export default {
  components: { CartListItem },
  name: 'CartList',
  data() {
    return {}
  },
  computed: {
    ...mapGetters(['cartList'])
  },
  methods: {}
}
</script>

<style type="text/css" scoped>
#cart-list {
  width: 96%;
  margin: 0 auto;
}
</style>
